/*
 *  This file is part of WWWPal.
 *
 *  Copyright (C) 2003  Dr. John Punin, Department of Computer Science
 *  Rensselaer Polytechnic Institute
 *
 *  WWWPal is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  WWWPal is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Foobar; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#include <sys/fcntl.h>
#include <math.h>
#include <assert.h>
#include <sys/stat.h>

#include "frame.h"

#define FLINE 120
#define WIDTH 1000    /* arbitrary width and height values */
#define HEIGHT 1000

typedef struct _main_frame{
  LNode_type *ltgr_frame;
  LNode_type *cur_node_tgf;
  int cur;
  int findex;
  char *basename;
  struct pt *nroot; /* next root vertex */
} mainFrame;

void
delete_main_frame(mainFrame *mf);
mainFrame *
new_main_frame(void);
int
read_command_line(mainFrame *gf, int argc, char *argv[]);
void
print_options(mainFrame *gf);
void
init_graph(GraphFrame *gf);
void 
print_nodes(GraphFrame *gf);
void 
print_selected_nodes(GraphFrame *gf);
void
execute_option(mainFrame *mf, int option);
int
execute_tree(GraphFrame *gf,int type_tree);
tgrFrame *
execute_line_graph(mainFrame *mf);
int
execute_barycentric(GraphFrame *gf);
int 
read_regular_file(char *filename, char **stext);
void
ask_method_tree(GraphFrame *gf);
void
execute_select(GraphFrame *gf, int case_select);
tgrFrame *
execute_grouping(mainFrame *mf);
tgrFrame *
execute_browsing(mainFrame *mf);
tgrFrame *
execute_simple_browsing(mainFrame *mf);

void
execute_report_hyperlinks(mainFrame *mf);

tgrFrame *
execute_reduce_graph(mainFrame *mf);
int 
choose_graph(mainFrame *mf);
int
delete_one_graph(mainFrame *mf);
char *
get_base_name(char *filename);

int
execute_report_hierarchical_tree(mainFrame *mf);

void
execute_pages_images_no_alt(mainFrame *mf);
void
execute_images_no_alt(mainFrame *mf);
void
execute_biggest_pages(mainFrame *mf);
void
execute_references_pages(mainFrame *mf);
void
generate_index_reports(mainFrame *mf);

void
execute_report_webgraph(mainFrame *mf);
void
execute_pages_broken_links(mainFrame *mf);
void
execute_broken_links(mainFrame *mf);
void
execute_report_pages(mainFrame *mf);

void
execute_orphan_pages(mainFrame *mf);
void
execute_broken_objects(mainFrame *mf);
void
execute_pages_without_title(mainFrame *mf);

void
execute_web_directory(mainFrame *mf);

void
execute_dir_clustering(mainFrame *mf);

void
execute_dir_partition(mainFrame *mf);

void
execute_first_partition(mainFrame *mf);

void
execute_second_partition(mainFrame *mf);

void
execute_site_map(mainFrame *mf);
void
execute_third_partition(mainFrame *mf);

void
set_shape_from_attributes(GraphFrame *gf);

void
execute_graph_clusters(mainFrame *mf);

void
generate_matrix_shortest_paths(mainFrame *mf);

void
execute_compute_cluster_coefficient(mainFrame *mf);



